#ifndef _FIELD_LINE_CLASS_H
#define _FIELD_LINE_CLASS_H
#include "GraphMathobj.h"

#define MAX_FIELD_LINE_SEGMENTS 1024

class FieldLineClass : public GraphMathObj
{
private:
	unsigned int build_idx;
	float cursor[3];
	int cursor_valid;
	float target_sample[3];
	float target_sample_dist;
	float target_closest_sample[3];
	float target_closest_sample_dist;
	int target_closest_sample_valid;

	void calculate_target_sample(float *);

public:
	float line_cursor[3];

	int m_idx;

	float boundary;
	float space_step;
	float interactive_space_step;
	int half_size;

	int active_flag;

	float (*segment_a)[3];
	float (*segment_b)[3];

	int memory_valid;

	//float field[MAX_FIELD_LINE_SEGMENTS][3];
	void (*field_function)(float *,float *);
	FieldLineClass(void);
	~FieldLineClass(void);
	void StdGLDraw(void);
	void StartLine(float *);
	void init_field_line(float *);

	void draw_branch(int branch_id);

	void set_cursor(float *);
	void enter_sample(void);
};

#endif _FIELD_LINE_CLASS_H